package com.kaolafm.kradio.k_navi_map.base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.kaolafm.kradio.k_navi_map.basemvp.BaseFragment;
import com.kaolafm.kradio.k_navi_map.basemvp.IPresenter;

/**
 * Created by kaolafm on 2018/4/19.
 */

public abstract class BaseMapFragment<P extends IPresenter> extends BaseFragment<P> {

    protected IMapViewManager mMapViewManager;

    protected Bundle mSavedInstanceState;
    protected Context mContext;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mSavedInstanceState = savedInstanceState;
        mContext = getContext();
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onResume() {
        super.onResume();
        mMapViewManager.onResume();
    }

    @Override
    public void onSaveInstanceState(@NonNull Bundle outState) {
        super.onSaveInstanceState(outState);
        mMapViewManager.onSaveInstanceState(outState);
    }

    @Override
    public void onPause() {
        super.onPause();
        mMapViewManager.onPause();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        mMapViewManager.onDestory();
    }
}
